/************************************************************
	File:		Turret.h
	Author:		Doug Monroe (dmonroe@fullsail.com)
	Course:		SGD 1304
	Purpose:	CTurret class handles computer-controlled
				turret entities
************************************************************/

#pragma once

#include "Entity.h"
#include "../../SGD Wrappers/IListener.h"


//***********************************************************
// CTurret class
//	- velocity-based entity
//	- overrides Update & Render methods to rotate to target
//	- overrides HandleEvent to listen for:
//		- "FIRE_LASER"	spawns a laser from the turret
class CTurret :	public CEntity, public IListener
{
public:
	//*******************************************************
	CTurret( void );
	virtual ~CTurret( void );

	
	//*******************************************************
	// IEntity Interface:
	virtual void	Update( float fElapsedTime )		override;	
	virtual void	Render( void )						override;
	virtual bool	CheckCollision( IEntity* pOther )	override;


	//*******************************************************
	// IListener Interface:
	virtual void	HandleEvent( CEvent* pEvent )		override;


	//*******************************************************
	// Accessor:
	CEntity*	GetTargetEntity( void ) const	{	return m_pTargetEntity;	}

	// Mutator:
	void		SetTargetEntity( CEntity* ptr );


private:
	//*******************************************************
	// Target to rotate & fire at
	CEntity*	m_pTargetEntity;
};

